#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n,q;
int a[N];
void solve()
{
	cin>>n>>q;
	string s;
	cin>>s;
	s=' '+s;
	for(int i=1;i<=n;i++)
	{
		a[i]=a[i-1]+(int)(s[i]-'a');
	}

	while(q--)
	{
		int l,r;
		cin>>l>>r;
		cout<<(a[r]-a[l-1]+(r-l+1))<<'\n';
	}





	
}

int main()
{
	close();
	//int T; cin>>T;
	//while (T--) solve();
	solve();
	return 0;
}